
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, 2012 and Azure
-- --------------------------------------------------
-- Date Created: 08/22/2019 18:23:55
-- Generated from EDMX file: D:\code\99cf\App_Code\Models\Model.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
USE [99cf];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- --------------------------------------------------


-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[L_AD]', 'U') IS NOT NULL
    DROP TABLE [dbo].[L_AD];
GO
IF OBJECT_ID(N'[dbo].[L_Classs]', 'U') IS NOT NULL
    DROP TABLE [dbo].[L_Classs];
GO
IF OBJECT_ID(N'[dbo].[L_Feedback]', 'U') IS NOT NULL
    DROP TABLE [dbo].[L_Feedback];
GO
IF OBJECT_ID(N'[dbo].[L_Form]', 'U') IS NOT NULL
    DROP TABLE [dbo].[L_Form];
GO
IF OBJECT_ID(N'[dbo].[L_Log]', 'U') IS NOT NULL
    DROP TABLE [dbo].[L_Log];
GO
IF OBJECT_ID(N'[dbo].[L_Newss]', 'U') IS NOT NULL
    DROP TABLE [dbo].[L_Newss];
GO
IF OBJECT_ID(N'[dbo].[L_RForm]', 'U') IS NOT NULL
    DROP TABLE [dbo].[L_RForm];
GO
IF OBJECT_ID(N'[dbo].[L_Tags]', 'U') IS NOT NULL
    DROP TABLE [dbo].[L_Tags];
GO
IF OBJECT_ID(N'[dbo].[Manages]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Manages];
GO
IF OBJECT_ID(N'[dbo].[S_Classs]', 'U') IS NOT NULL
    DROP TABLE [dbo].[S_Classs];
GO
IF OBJECT_ID(N'[dbo].[S_Goods]', 'U') IS NOT NULL
    DROP TABLE [dbo].[S_Goods];
GO
IF OBJECT_ID(N'[dbo].[S_Order]', 'U') IS NOT NULL
    DROP TABLE [dbo].[S_Order];
GO
IF OBJECT_ID(N'[dbo].[S_UADDRESS]', 'U') IS NOT NULL
    DROP TABLE [dbo].[S_UADDRESS];
GO
IF OBJECT_ID(N'[dbo].[U_CZ]', 'U') IS NOT NULL
    DROP TABLE [dbo].[U_CZ];
GO
IF OBJECT_ID(N'[dbo].[U_DHJF]', 'U') IS NOT NULL
    DROP TABLE [dbo].[U_DHJF];
GO
IF OBJECT_ID(N'[dbo].[U_QD]', 'U') IS NOT NULL
    DROP TABLE [dbo].[U_QD];
GO
IF OBJECT_ID(N'[dbo].[U_TX]', 'U') IS NOT NULL
    DROP TABLE [dbo].[U_TX];
GO
IF OBJECT_ID(N'[dbo].[U_TZ]', 'U') IS NOT NULL
    DROP TABLE [dbo].[U_TZ];
GO
IF OBJECT_ID(N'[dbo].[User]', 'U') IS NOT NULL
    DROP TABLE [dbo].[User];
GO
IF OBJECT_ID(N'[dbo].[WeChatConfig]', 'U') IS NOT NULL
    DROP TABLE [dbo].[WeChatConfig];
GO
IF OBJECT_ID(N'[dbo].[WXUserInfo]', 'U') IS NOT NULL
    DROP TABLE [dbo].[WXUserInfo];
GO

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'L_AD'
CREATE TABLE [dbo].[L_AD] (
    [NID] int IDENTITY(1,1) NOT NULL,
    [ClassId] int  NULL,
    [Title] nvarchar(250)  NULL,
    [sTitle] nvarchar(250)  NULL,
    [Author] nvarchar(100)  NULL,
    [From] nvarchar(100)  NULL,
    [Tag] nvarchar(200)  NULL,
    [ZhaiYao] nvarchar(500)  NULL,
    [Img] nvarchar(250)  NULL,
    [Content] nvarchar(4000)  NULL,
    [Click] nvarchar(50)  NULL,
    [Url] nvarchar(250)  NULL,
    [Time] datetime  NULL,
    [CreatTime] datetime  NULL,
    [IsTop] bit  NULL,
    [IsHot] bit  NULL,
    [IsSlide] bit  NULL,
    [IsLock] bit  NULL,
    [IsRed] bit  NULL,
    [Img2] nvarchar(250)  NULL
);
GO

-- Creating table 'L_Classs'
CREATE TABLE [dbo].[L_Classs] (
    [CID] int IDENTITY(1,1) NOT NULL,
    [CNmae] nvarchar(50)  NULL,
    [CpareID] int  NULL,
    [CKeyWord] nvarchar(255)  NULL,
    [CUrl] nvarchar(200)  NULL,
    [CTag] nvarchar(2000)  NULL,
    [CTag2] nvarchar(2000)  NULL,
    [CTag3] nvarchar(2000)  NULL,
    [CType] int  NULL,
    [CSubSkin] nvarchar(50)  NULL,
    [CSkin] nvarchar(50)  NULL
);
GO

-- Creating table 'L_Feedback'
CREATE TABLE [dbo].[L_Feedback] (
    [FID] int IDENTITY(1,1) NOT NULL,
    [NID] int  NULL,
    [FName] nvarchar(100)  NULL,
    [FTel] nvarchar(100)  NULL,
    [FQQ] nvarchar(100)  NULL,
    [FMail] nvarchar(100)  NULL,
    [FTitle] nvarchar(250)  NULL,
    [FContent] nvarchar(4000)  NULL,
    [FTime] nvarchar(50)  NULL,
    [FReContent] nvarchar(4000)  NULL,
    [FReTime] nvarchar(50)  NULL,
    [FLock] nvarchar(10)  NULL
);
GO

-- Creating table 'L_Form'
CREATE TABLE [dbo].[L_Form] (
    [FID] int IDENTITY(1,1) NOT NULL,
    [FNmae] nvarchar(100)  NULL,
    [FStat] int  NULL,
    [Fother] nvarchar(500)  NULL,
    [F1] nvarchar(500)  NULL,
    [FMust] int  NULL,
    [FTime] nvarchar(50)  NULL,
    [F1C] nvarchar(500)  NULL
);
GO

-- Creating table 'L_Log'
CREATE TABLE [dbo].[L_Log] (
    [LID] int IDENTITY(1,1) NOT NULL,
    [L_TiTLE] nvarchar(250)  NULL,
    [L_IP] nvarchar(100)  NULL,
    [L_Time] datetime  NULL,
    [L_Act] nvarchar(200)  NULL,
    [L_UID] nvarchar(10)  NULL
);
GO

-- Creating table 'L_Newss'
CREATE TABLE [dbo].[L_Newss] (
    [NID] int IDENTITY(1,1) NOT NULL,
    [ClassId] int  NULL,
    [Title] nvarchar(255)  NULL,
    [sTitle] nvarchar(255)  NULL,
    [Author] nvarchar(255)  NULL,
    [From] nvarchar(255)  NULL,
    [Tag] nvarchar(255)  NULL,
    [ZhaiYao] nvarchar(500)  NULL,
    [Img] nvarchar(250)  NULL,
    [Content] nvarchar(max)  NULL,
    [Click] nvarchar(50)  NULL,
    [Url] nvarchar(255)  NULL,
    [Time] datetime  NULL,
    [CreatTime] datetime  NULL,
    [IsTop] bit  NULL,
    [IsHot] bit  NULL,
    [IsSlide] bit  NULL,
    [IsLock] bit  NULL,
    [IsRed] bit  NULL,
    [Img2] nvarchar(255)  NULL,
    [piclist] nvarchar(1500)  NULL,
    [piclistTag] nvarchar(max)  NULL,
    [fujian] nvarchar(25)  NULL
);
GO

-- Creating table 'L_RForm'
CREATE TABLE [dbo].[L_RForm] (
    [FrID] int IDENTITY(1,1) NOT NULL,
    [FrName] nvarchar(100)  NULL,
    [Fr1] nvarchar(500)  NULL,
    [Fr2] nvarchar(2000)  NULL,
    [FrTime] datetime  NULL,
    [FrRepaly] nvarchar(1000)  NULL,
    [FrReOk] int  NULL,
    [FrReTime] datetime  NULL,
    [Fr1c] nvarchar(500)  NULL,
    [Fr2c] nvarchar(500)  NULL,
    [FID] int  NULL
);
GO

-- Creating table 'L_Tags'
CREATE TABLE [dbo].[L_Tags] (
    [TID] int IDENTITY(1,1) NOT NULL,
    [TName] nvarchar(50)  NULL,
    [TContent] nvarchar(max)  NULL,
    [TNotice] nvarchar(200)  NULL
);
GO

-- Creating table 'Manages'
CREATE TABLE [dbo].[Manages] (
    [MID] int IDENTITY(1,1) NOT NULL,
    [MName] nvarchar(80)  NULL,
    [MPWD] nvarchar(80)  NULL,
    [MRole] nvarchar(max)  NULL,
    [MPower] nvarchar(max)  NULL,
    [MWXPower] nvarchar(max)  NULL,
    [MHRPower] nvarchar(max)  NULL
);
GO

-- Creating table 'S_Classs'
CREATE TABLE [dbo].[S_Classs] (
    [SCID] int IDENTITY(1,1) NOT NULL,
    [SCNmae] nvarchar(50)  NULL,
    [SCpareID] int  NULL,
    [SCKeyWord] nvarchar(255)  NULL,
    [SCUrl] nvarchar(200)  NULL,
    [SCTag] nvarchar(2000)  NULL,
    [SCTag2] nvarchar(2000)  NULL,
    [SCTag3] nvarchar(2000)  NULL,
    [SCType] int  NULL,
    [SCIMG] nvarchar(50)  NULL,
    [SCSIMG] nvarchar(50)  NULL
);
GO

-- Creating table 'S_Order'
CREATE TABLE [dbo].[S_Order] (
    [OrderID] int IDENTITY(1,1) NOT NULL,
    [SPID] int  NULL,
    [ISvipleve] int  NULL,
    [SPImgUrl] nvarchar(500)  NULL,
    [SPName] nvarchar(500)  NULL,
    [SPrice] decimal(18,2)  NULL,
    [STruePrice] decimal(18,2)  NULL,
    [lastPrice] decimal(18,2)  NULL,
    [ONumber] int  NULL,
    [ParentFxprice] decimal(18,2)  NULL,
    [ParentParentFxprice] decimal(18,2)  NULL,
    [TempleParentOopenID] nvarchar(50)  NULL,
    [ParentParentOopenID] nvarchar(50)  NULL,
    [ParentOopenID] nvarchar(50)  NULL,
    [OopenID] nvarchar(50)  NULL,
    [OPeople] nvarchar(500)  NULL,
    [Otel] nvarchar(500)  NULL,
    [OProvance] nvarchar(50)  NULL,
    [OCity] nvarchar(50)  NULL,
    [ODistrict] nvarchar(250)  NULL,
    [OStreet] nvarchar(250)  NULL,
    [OAddress] nvarchar(500)  NULL,
    [OCount] int  NULL,
    [OCredits] int  NULL,
    [OPostway] nvarchar(500)  NULL,
    [OPostage] int  NULL,
    [OPostCode] int  NULL,
    [OMsg] nvarchar(500)  NULL,
    [OTCredits] int  NULL,
    [OState] nvarchar(50)  NULL,
    [OType] nvarchar(50)  NULL,
    [OCreatTime] datetime  NULL,
    [OpayType] int  NULL,
    [OpayTime] datetime  NULL,
    [pay_status] nvarchar(50)  NULL,
    [OTradeNO_] nvarchar(500)  NULL,
    [OUSERID] int  NULL,
    [OFHTime] datetime  NULL,
    [OrederNum] nvarchar(500)  NULL,
    [OLogisticsNum] nvarchar(500)  NULL,
    [OLogisticsName] nvarchar(500)  NULL,
    [OCodeNum] nvarchar(50)  NULL,
    [ORemarks] nvarchar(500)  NULL,
    [Order_no] nvarchar(50)  NULL,
    [blessing_message] nvarchar(500)  NULL,
    [blessing_tpl] nvarchar(500)  NULL,
    [reciever_id] int  NULL,
    [info_unique_id] int  NULL,
    [info_num] int  NULL,
    [info_amount] decimal(18,0)  NULL,
    [Order_another_tag] int  NULL,
    [reciever_batch] int  NULL,
    [push_tag] int  NULL,
    [NOrderFrom] int  NULL
);
GO

-- Creating table 'S_UADDRESS'
CREATE TABLE [dbo].[S_UADDRESS] (
    [UAID] int IDENTITY(1,1) NOT NULL,
    [UID] int  NULL,
    [Uopenid] nvarchar(50)  NULL,
    [UAPhone] nvarchar(500)  NULL,
    [UAProvance] nvarchar(500)  NULL,
    [UACity] nvarchar(500)  NULL,
    [UADistrict] nvarchar(500)  NULL,
    [UAStreet] nvarchar(500)  NULL,
    [UAFullAddress] nvarchar(500)  NULL,
    [UAAddTime] nvarchar(500)  NULL,
    [UAState] nvarchar(50)  NULL,
    [Uname] nvarchar(50)  NULL
);
GO

-- Creating table 'U_CZ'
CREATE TABLE [dbo].[U_CZ] (
    [CZID] int IDENTITY(1,1) NOT NULL,
    [UGuid] nvarchar(50)  NULL,
    [CZMoney] decimal(8,2)  NULL,
    [CZTime] datetime  NULL,
    [CZPayType] nvarchar(10)  NULL,
    [Other] nvarchar(200)  NULL,
    [CZstat] int  NULL
);
GO

-- Creating table 'U_TX'
CREATE TABLE [dbo].[U_TX] (
    [TXID] int IDENTITY(1,1) NOT NULL,
    [UGuid] nvarchar(50)  NULL,
    [TXMoney] decimal(8,2)  NULL,
    [TXTime] datetime  NULL,
    [TXstat] int  NULL,
    [TXother] nvarchar(500)  NULL,
    [TXname] nvarchar(100)  NULL,
    [TXzhifubao] nvarchar(100)  NULL
);
GO

-- Creating table 'WeChatConfig'
CREATE TABLE [dbo].[WeChatConfig] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [WeChatName] nvarchar(100)  NULL,
    [APPID] nvarchar(100)  NULL,
    [MCHID] nvarchar(100)  NULL,
    [KEY] nvarchar(100)  NULL,
    [APPSECRET] nvarchar(100)  NULL,
    [PayUrl] nvarchar(200)  NULL,
    [IsUser] bit  NULL,
    [PayAPI] nvarchar(200)  NULL,
    [ReUrl] nvarchar(200)  NULL,
    [NotifyUrl] nvarchar(200)  NULL
);
GO

-- Creating table 'WXUserInfo'
CREATE TABLE [dbo].[WXUserInfo] (
    [wxId] int IDENTITY(1,1) NOT NULL,
    [SOpenId] nvarchar(500)  NULL,
    [POpenId] nvarchar(500)  NULL,
    [SNickName] nvarchar(500)  NULL,
    [SHeadImg] nvarchar(500)  NULL,
    [LEVE] int  NULL,
    [PUID] int  NULL,
    [STATE] int  NULL,
    [LASTLOGINTIME] datetime  NULL,
    [REGTIME] datetime  NULL,
    [MemberDate] datetime  NULL,
    [TrueName] varchar(500)  NULL,
    [Phone] varchar(50)  NULL,
    [Address] varchar(500)  NULL,
    [IDCard] varchar(50)  NULL,
    [BankNumber] varchar(500)  NULL,
    [BankName] varchar(500)  NULL,
    [Uid] int  NULL,
    [Utel] varchar(50)  NULL,
    [UCode] varchar(50)  NULL,
    [UParCode] varchar(50)  NULL,
    [vipLeve] int  NULL,
    [UvipTime] datetime  NULL
);
GO

-- Creating table 'U_TZ'
CREATE TABLE [dbo].[U_TZ] (
    [TZID] int IDENTITY(1,1) NOT NULL,
    [UGuid] nvarchar(50)  NULL,
    [TZMoney] decimal(8,2)  NULL,
    [TZTime] datetime  NULL,
    [TZstat] int  NULL,
    [TZPayType] nchar(10)  NULL,
    [TZPayTime] datetime  NULL,
    [DHState] int  NULL
);
GO

-- Creating table 'S_Goods'
CREATE TABLE [dbo].[S_Goods] (
    [GID] int IDENTITY(1,1) NOT NULL,
    [SCCLASSID] int  NULL,
    [GName] nvarchar(50)  NULL,
    [GDAY] int  NULL,
    [GPriceYJ] decimal(18,2)  NULL,
    [GPrice] decimal(18,2)  NULL,
    [GPrice2] decimal(18,2)  NULL,
    [GPrice3] decimal(18,2)  NULL,
    [FXPrice2] decimal(18,2)  NULL,
    [FXPrice] decimal(18,2)  NULL,
    [GCounts] int  NULL,
    [GSoldCount] int  NULL,
    [GImg] nvarchar(500)  NULL,
    [GSImg] nvarchar(500)  NULL,
    [GContent] nvarchar(max)  NULL,
    [GPost] nvarchar(150)  NULL,
    [GPostCost] int  NULL,
    [GTime] datetime  NULL,
    [GIState] bit  NULL,
    [G_Introduce] nvarchar(1500)  NULL,
    [CodeClassID] int  NULL,
    [GSort] int  NULL,
    [GvipLeve] int  NULL,
    [GArea] int  NULL
);
GO

-- Creating table 'U_DHJF'
CREATE TABLE [dbo].[U_DHJF] (
    [DHID] int IDENTITY(1,1) NOT NULL,
    [UGuid] nvarchar(50)  NULL,
    [DHJfs] int  NULL,
    [DHTime] datetime  NULL,
    [DHmoney] decimal(8,2)  NULL
);
GO

-- Creating table 'U_QD'
CREATE TABLE [dbo].[U_QD] (
    [QDID] int IDENTITY(1,1) NOT NULL,
    [UGuid] nvarchar(100)  NULL,
    [QDTime] datetime  NULL,
    [QDjifens] int  NULL
);
GO

-- Creating table 'User'
CREATE TABLE [dbo].[User] (
    [UID] int IDENTITY(1,1) NOT NULL,
    [UGuid] nvarchar(50)  NULL,
    [UparentId] nvarchar(50)  NULL,
    [UTel] nvarchar(100)  NULL,
    [Umima] nvarchar(50)  NULL,
    [Utouxiang] nvarchar(max)  NULL,
    [Uname] nvarchar(100)  NULL,
    [Uzhifubao] nvarchar(50)  NULL,
    [wxID] nvarchar(100)  NULL,
    [Ustate] int  NULL,
    [LoginTime] datetime  NULL,
    [RegTime] datetime  NULL,
    [Ujifen] int  NULL,
    [Uexchangegoods] int  NULL,
    [UDHmoney] decimal(8,2)  NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [NID] in table 'L_AD'
ALTER TABLE [dbo].[L_AD]
ADD CONSTRAINT [PK_L_AD]
    PRIMARY KEY CLUSTERED ([NID] ASC);
GO

-- Creating primary key on [CID] in table 'L_Classs'
ALTER TABLE [dbo].[L_Classs]
ADD CONSTRAINT [PK_L_Classs]
    PRIMARY KEY CLUSTERED ([CID] ASC);
GO

-- Creating primary key on [FID] in table 'L_Feedback'
ALTER TABLE [dbo].[L_Feedback]
ADD CONSTRAINT [PK_L_Feedback]
    PRIMARY KEY CLUSTERED ([FID] ASC);
GO

-- Creating primary key on [FID] in table 'L_Form'
ALTER TABLE [dbo].[L_Form]
ADD CONSTRAINT [PK_L_Form]
    PRIMARY KEY CLUSTERED ([FID] ASC);
GO

-- Creating primary key on [LID] in table 'L_Log'
ALTER TABLE [dbo].[L_Log]
ADD CONSTRAINT [PK_L_Log]
    PRIMARY KEY CLUSTERED ([LID] ASC);
GO

-- Creating primary key on [NID] in table 'L_Newss'
ALTER TABLE [dbo].[L_Newss]
ADD CONSTRAINT [PK_L_Newss]
    PRIMARY KEY CLUSTERED ([NID] ASC);
GO

-- Creating primary key on [FrID] in table 'L_RForm'
ALTER TABLE [dbo].[L_RForm]
ADD CONSTRAINT [PK_L_RForm]
    PRIMARY KEY CLUSTERED ([FrID] ASC);
GO

-- Creating primary key on [TID] in table 'L_Tags'
ALTER TABLE [dbo].[L_Tags]
ADD CONSTRAINT [PK_L_Tags]
    PRIMARY KEY CLUSTERED ([TID] ASC);
GO

-- Creating primary key on [MID] in table 'Manages'
ALTER TABLE [dbo].[Manages]
ADD CONSTRAINT [PK_Manages]
    PRIMARY KEY CLUSTERED ([MID] ASC);
GO

-- Creating primary key on [SCID] in table 'S_Classs'
ALTER TABLE [dbo].[S_Classs]
ADD CONSTRAINT [PK_S_Classs]
    PRIMARY KEY CLUSTERED ([SCID] ASC);
GO

-- Creating primary key on [OrderID] in table 'S_Order'
ALTER TABLE [dbo].[S_Order]
ADD CONSTRAINT [PK_S_Order]
    PRIMARY KEY CLUSTERED ([OrderID] ASC);
GO

-- Creating primary key on [UAID] in table 'S_UADDRESS'
ALTER TABLE [dbo].[S_UADDRESS]
ADD CONSTRAINT [PK_S_UADDRESS]
    PRIMARY KEY CLUSTERED ([UAID] ASC);
GO

-- Creating primary key on [CZID] in table 'U_CZ'
ALTER TABLE [dbo].[U_CZ]
ADD CONSTRAINT [PK_U_CZ]
    PRIMARY KEY CLUSTERED ([CZID] ASC);
GO

-- Creating primary key on [TXID] in table 'U_TX'
ALTER TABLE [dbo].[U_TX]
ADD CONSTRAINT [PK_U_TX]
    PRIMARY KEY CLUSTERED ([TXID] ASC);
GO

-- Creating primary key on [Id] in table 'WeChatConfig'
ALTER TABLE [dbo].[WeChatConfig]
ADD CONSTRAINT [PK_WeChatConfig]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [wxId] in table 'WXUserInfo'
ALTER TABLE [dbo].[WXUserInfo]
ADD CONSTRAINT [PK_WXUserInfo]
    PRIMARY KEY CLUSTERED ([wxId] ASC);
GO

-- Creating primary key on [TZID] in table 'U_TZ'
ALTER TABLE [dbo].[U_TZ]
ADD CONSTRAINT [PK_U_TZ]
    PRIMARY KEY CLUSTERED ([TZID] ASC);
GO

-- Creating primary key on [GID] in table 'S_Goods'
ALTER TABLE [dbo].[S_Goods]
ADD CONSTRAINT [PK_S_Goods]
    PRIMARY KEY CLUSTERED ([GID] ASC);
GO

-- Creating primary key on [DHID] in table 'U_DHJF'
ALTER TABLE [dbo].[U_DHJF]
ADD CONSTRAINT [PK_U_DHJF]
    PRIMARY KEY CLUSTERED ([DHID] ASC);
GO

-- Creating primary key on [QDID] in table 'U_QD'
ALTER TABLE [dbo].[U_QD]
ADD CONSTRAINT [PK_U_QD]
    PRIMARY KEY CLUSTERED ([QDID] ASC);
GO

-- Creating primary key on [UID] in table 'User'
ALTER TABLE [dbo].[User]
ADD CONSTRAINT [PK_User]
    PRIMARY KEY CLUSTERED ([UID] ASC);
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------